import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 教练钱包信息 */
export interface CoachWallet {
          id: number; // ID
          coachId?: number; // 教练ID
          balance?: number; // 余额（单位分）
          totalEarnings?: number; // 累计收益（单位分）
  }

// 教练钱包 API
export const CoachWalletApi = {
  // 查询教练钱包分页
  getCoachWalletPage: async (params: any) => {
    return await request.get({ url: `/business/coach-wallet/page`, params })
  },

  // 查询教练钱包详情
  getCoachWallet: async (id: number) => {
    return await request.get({ url: `/business/coach-wallet/get?id=` + id })
  },

  // 新增教练钱包
  createCoachWallet: async (data: CoachWallet) => {
    return await request.post({ url: `/business/coach-wallet/create`, data })
  },

  // 修改教练钱包
  updateCoachWallet: async (data: CoachWallet) => {
    return await request.put({ url: `/business/coach-wallet/update`, data })
  },

  // 删除教练钱包
  deleteCoachWallet: async (id: number) => {
    return await request.delete({ url: `/business/coach-wallet/delete?id=` + id })
  },

  /** 批量删除教练钱包 */
  deleteCoachWalletList: async (ids: number[]) => {
    return await request.delete({ url: `/business/coach-wallet/delete-list?ids=${ids.join(',')}` })
  },

  // 导出教练钱包 Excel
  exportCoachWallet: async (params) => {
    return await request.download({ url: `/business/coach-wallet/export-excel`, params })
  },
}